]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
hwtest.js: Fix median computation
authorOwen W. Taylor <otaylor@fishsoup.net>
Sun, 10 Aug 2014 07:23:48 +0000 (09:23 +0200)
committerOwen W. Taylor <otaylor@fishsoup.net>
Sun, 10 Aug 2014 07:25:10 +0000 (09:25 +0200)
By default Array.prototype.sort() sorts all values by converting
them to strings, even numbers!

js/perf/hwtest.js

index fbadde43383facd06534bb931525d77f6c045b58..9cc0db85e386cae65023c8715b942b3b8fd56bc5 100644 (file)
@@ -270,7 +270,7 @@ function script_redrawTestDone(time) {
 function script_collectTimings(time) {
     for (let timing in redrawTimes) {
         let times = redrawTimes[timing];
-        times.sort();
+        times.sort(function(a, b) { return a - b });
 
         let len = times.length;
         let median;